package com.example.mybatis_plus_use.service.impl;

import com.example.mybatis_plus_use.entity.Category;
import com.example.mybatis_plus_use.mapper.CategoryMapper;
import com.example.mybatis_plus_use.service.CategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商品分类表 服务实现类
 * </p>
 *
 * @author zjh
 * @since 2025-01-16
 */
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {


    @Override
    public String getNameById(Long categoryId) {
        return lambdaQuery().eq(Category::getId, categoryId).select(Category::getName).one().getName();
    }
}
